<template>
    <el-container style="display: flex;flex-direction: column;height: 100%">
        <el-header style="flex: 0 0 auto;background-color: #054568;" height="auto">
            <div class="header">
                <img  src="@/assets/logo.png" alt="保定学院" style="height: 80px;"/>
                <h1 class="font" >大学生创新创业管理系统</h1>
            </div>
        </el-header>
        <div class="login">
            <Transition enter-active-class="animated animate__backInRight"
                        leave-active-class="animated animate__backOutLeft"
                        mode="out-in"
            >
                <Component :is="tabs[tab]" v-model:tab="tab" />
            </Transition>
        </div>
        <div class="main" style=" flex: 1 0 auto;">
            <el-carousel autoplay trigger="click" :height="imageHeight">
                <el-carousel-item v-for="image in images" :key="image" >
                    <template #default>
                        <img :src="image" fit="cover" style="height: 100%;width: 100%"/>
                    </template>
                </el-carousel-item>
            </el-carousel>
        </div>
        <el-footer style="flex: 0 0 auto;" height="auto" class="footer">
            <el-divider style="margin: 0.5em;background-color: rgb(84, 92, 100);"/>
            <div style="width: 40%;padding: 0 10%;display: flex;justify-content: space-between;align-items: center">
                <div style="display: flex;align-items: center">
                    <img style="width: 40px;margin-right: 1em" src="@/assets/logo_icon_white.png" alt="bdu">
                    <h1>大学生创新创业管理系统</h1>
                </div>
                <div>
                    <span>法律声明</span>
                    <el-divider style="margin: 0 0.5em" direction="vertical"></el-divider>
                    <span>友情链接</span>
                    <el-divider style="margin: 0 0.5em" direction="vertical"></el-divider>
                    <span>联系我们</span>
                    <br/>
                    <br/>
                    <span class="copyright">©Copyright版权所有：保定学院</span>
                </div>
            </div>
        </el-footer>
    </el-container>
</template>

<script setup>
import {ref} from 'vue'
import Login from "@/views/Login/components/Login.vue";
import Register from "@/views/Login/components/Register.vue";

let images = ref([
    "/img/yuanshen2.jpg",
    "/img/beijing1.jpg",
    "/img/beijing2.jpg",
])
let imageHeight = ref(window.innerHeight+"px")
window.onresize = () =>{
    imageHeight.value = window.innerHeight + "px"
}
const tabs = {
    login:Login,
    register:Register
}
let tab = ref("login")

</script>
<style lang="scss" scoped>
html,body{
    height: 100%;
}
.header {
    position: relative;
    padding: 10px 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .font{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-family: 'KaiTi', serif;
        color: #fff;
        font-size: 40px;
    }
}
.login{
    position: fixed;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    z-index: 1000;
}
.carousel-item {
    color: #475669;
    opacity: 0.75;
    margin: 0;
    text-align: center;
}

.el-carousel__item h3 {
    color: #475669;
    opacity: 0.75;
    display: flex;
    align-items: center;
    margin: 0;
    text-align: center;
    height: 100%;
}

.footer{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #303133;
    color: white;
    text-align: center;
    font-size: 16px;
}

.el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
}
.el-carousel__item:nth-child(2n + 1) {
    background-color: #d3dce6;
}
.copyright{
    font-size: 12px;
}
</style>